<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>我的项目</title>
    <link href="/res/css/respective/priceAsk/buyer.css" rel="stylesheet">
    <script src="/res/js/common/jquery.1.9.1.min.js"></script>
</head>
<body>
[#assign  menucode ="myProject"]
<div class="warp">
[#include "/front/common/front_headAzt.html"]
    <div class="backcontent">
    [#include "/front/common/front_leftAzt.html"]
        <div class="back-main">
            <div class="mainContent">
                <div class="mainContentWhite">
                    <h1>我的项目</h1>
                    <button class="roleButt" style="margin-top: 0px;" target="_blank" onclick="window.open('/enquiry/all/choose')" type="button">发布询价</button>
                    <hr>
                    <div>
                        <form id="searchform">
                            <label>项目/甲方名称：</label> <input class="time" style="width: 160px;" type="text" name="pnameOcname" placeholder="请输入项目/甲方名称" value="${projects.params.pnameOcname!}"/> <label>状态：</label>

                            <div class="ppSelect">
                                <select name="state">
                                    <option value="-1" [#if projects.params.state==-1 ]selected="selected"[/#if]>所有状态</option>
                                    <option value="1" [#if projects.params.state==1 ]selected="selected"[/#if]>进行中</option>
                                    <option value="2" [#if projects.params.state==2 ]selected="selected"[/#if]>已取消</option>
                                </select>
                            </div>
                        [#if companies?? ]
                            <label> 公司：</label>
                            <div class="ppSelect" >
                                <select name="onecustomerId" style="max-width: 200px;overflow: hidden" >
                                    <option   value="0" [#if !(projects.params.onecustomerId??)|| projects.params.onecustomerId==0 ]selected="selected"[/#if]>所有公司</option>
                                    [#list companies as company ]
                                        <option  value="${company.id}" [#if projects.params.onecustomerId?? && projects.params.onecustomerId ==company.id ]selected="selected"[/#if]>${company.companyName}</option>
                                     [/#list]
                                </select>
                            </div>
                        [/#if]

                            <label> 发布时间：</label>
                            <input type="text" id="start" class="dateInput laydate-icon time" style="width: 100px;" name="startTime" autocomplete="off" value="${projects.params.startTime!}"/>
                            <label>至</label>
                            <input type="text" id="end" class="dateInput laydate-icon time" style="width: 100px;" name="endTime" autocomplete="off" value="${projects.params.endTime!}"/>
                            <button onclick="projectsosuo()" class="souSuo" style="">搜索
                            </button>
                        </form>
                    </div>
                    <table class="table noBorder">
                        <thead>
                        <tr>
                            <th>项目名称</th>
                            <th>发布公司</th>
                            <th>甲方名称</th>
                            <th>询价次数</th>
                            <th>报价次数</th>
                            <th>状态</th>
                            <th>发布日期</th>
                            <th style="border-right: 1px solid #e9e9e9;">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <!--默认显示8行-->
                        [#list projects.list as proj]
                        <tr>
                            <td><a href="javascript:void(0)" onclick="goDetail('${proj.id}')" >${proj.projectName!}</a></td>
                            <td>${proj.companyName!}</td>
                            <td>${proj.customerName!}</td>
                            <td>${proj.count!0}</td>
                            <td>${proj.qcount!0}</td>
                            <td>[#if proj.state??][#if proj.state==1]进行中[#elseif proj.state==2]项目关闭[#else][/#if][/#if]</td>
                            <td>${(proj.pubTime?string("yyyy-MM-dd"))!}</td>
                            <td style="border-right: 1px solid #e9e9e9;">
                                <a href="javascript:void(0)" onclick="goDetail('${proj.id}')"> 查看详情 </a>
                            </td>
                        </tr>
                        [/#list]
                        </tbody>
                        <tfoot class="goFenYe">
                        [@fenye p = projects form = 'infoForm' /]</tfoot>
                    </table>

                </div>
            </div>
        </div>
        <!-- 底部菜单-->
    [#include "/front/common/front_footerAzt.html"]
    </div>

    <script src="/res/js/structure/struture.js"></script>
    <script src="/res/js/common/common.js"></script>
    <script src="/res/third/laydate/laydate.js"></script>
    <script type="text/javascript">

        var start = {
            elem: '#start',
            format: 'YYYY-MM-DD',
        [#if (projects.params.endTime)??]
            max: '${projects.params.endTime}', //最大日期
        [/#if]
            istime: false,
            istoday: false,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas;//将结束日的初始值设定为开始日
            }
        };

        var end = {
            elem: '#end',
            format: 'YYYY-MM-DD',
        [#if (projects.params.startTime)??]
            min: '${projects.params.startTime}',
        [/#if]
            istime: false,
            istoday: false,
            choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        laydate(start);
        laydate(end);


        /*搜索*/
        function projectsosuo() {
            var lpath = location.pathname;
            var pageNo = $("#pageNo").val();
            $("#searchform").attr("action", lpath + "?pageNo=" + pageNo);
            $("#searchform").submit();
        }

        function goDetail(id) {
            window.location.href = "/enquiry/project/detail/p/" + id + "/t/2"
        }


       /*  function sendEnq() {
            //发布询价
            window.location.href = "/enquiry/all/choose";
        } */

    </script>
</body>
</html>
